package com.earl.eatbao.service.impl;

import java.util.List;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.earl.eatbao.commons.dao.BaseRepsitoty;
import com.earl.eatbao.commons.service.BaseServiceImpl;
import com.earl.eatbao.dao.eatbao.MessageDao;
import com.earl.eatbao.domain.eatbao.Message;
import com.earl.eatbao.service.MessageService;

/**
 * 消息业务实现类
 * @author Administrator
 * @version 1.0
 * @updated 23-十一月-2016 23:07:12
 */
@Service("messageService")
public class MessageServiceImpl extends BaseServiceImpl<Message, Long> implements MessageService {

	// desc:日记工具logger
	private static final Logger logger = LoggerFactory.getLogger(MessageServiceImpl.class);

	@Autowired
	private MessageDao messageDao;

	@Override
	protected BaseRepsitoty<Message, Long> getDao() {
		// TODO Auto-generated method stub
		return messageDao;
	}


	@Override
	public List<Message> findByUserId(Long userId) {

		return messageDao.findByUserId(userId);
	}

	@Override
	public List<Message> findByUserIdAndRead(Long userId) {
		return messageDao.findByUserIdAndIsRead(userId, false);
	}
}